<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 11. 请自定义一个注册事件的兼容函数，要求兼容三种注册事件方法。 -->
    <script>
        function addEvent(ele,type,fn) {
            if (ele.addEventListener) {
                ele.addEventListener(type,fn);
            } else {
                ele.addEvent("on" + type,fn);
            }
        }
    </script>
</body>
</html>